<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Rules Predicated on Actions</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Rules Predicated on Actions' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">if</a></li><li><a href="index.html#4">Chapter 4: Actions</a></li><li><b>Rules Predicated on Actions</b></li></ul></div>
<p class="purpose">Rules can be set to run only if the action matches a given pattern.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>Many rules are predicated on action patterns: "Instead of opening a closed
door", say, is a rule in the "instead of opening" rulebook which is predicated
on the action applying to "a closed door". This is stored in the following
actions-feature corner of the <a href="../assertions-module/5-rcd.html" class="internal">Runtime Context Data (in assertions)</a> for the rule.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">always_test_actor</span><span class="plain-syntax">; </span><span class="comment-syntax"> ...even if no AP was given, test that actor is player?</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">never_test_actor</span><span class="plain-syntax">; </span><span class="comment-syntax"> ...for instance, for a parametrised rather than action rulebook</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">marked_for_anyone</span><span class="plain-syntax">; </span><span class="comment-syntax"> any actor is allowed to perform this action</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="function-syntax">ActionRules::new_rcd_data</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">ActionRules::new_rcd_data</span></span>:<br/><a href="4-rpoa.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ard</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ard</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">always_test_actor</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ard</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">never_test_actor</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ard</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">marked_for_anyone</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">ard</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure actions_rcd_data is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>Note that if the actions feature is inactive, then this never runs...
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::new_rcd</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">ActionRules::new_rcd</span></span>:<br/>Actions Plugin - <a href="4-ap.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CREATE_RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">, </span><a href="4-rpoa.html#SP1" class="function-link"><span class="function-syntax">ActionRules::new_rcd_data</span></a><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>...with the result that <span class="extract"><span class="extract-syntax">arcd</span></span> is always null in the function below.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::set_always_test_actor</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arcd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">arcd</span><span class="plain-syntax">) </span><span class="identifier-syntax">arcd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">always_test_actor</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::get_always_test_actor</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arcd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">arcd</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">arcd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">always_test_actor</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::clear_always_test_actor</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arcd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">arcd</span><span class="plain-syntax">) </span><span class="identifier-syntax">arcd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">always_test_actor</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::set_never_test_actor</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arcd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">arcd</span><span class="plain-syntax">) </span><span class="identifier-syntax">arcd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">never_test_actor</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::get_never_test_actor</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arcd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">arcd</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">arcd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">never_test_actor</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::set_marked_for_anyone</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arcd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">arcd</span><span class="plain-syntax">) </span><span class="identifier-syntax">arcd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">marked_for_anyone</span><span class="plain-syntax"> = </span><span class="identifier-syntax">to</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::get_marked_for_anyone</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arcd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">arcd</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">arcd</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">marked_for_anyone</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>The following all make use the action pattern <span class="extract"><span class="extract-syntax">idrcd-&gt;ap</span></span> in the RCD. This
seems a little odd: why isn't it in the <a href="4-rpoa.html#SP1" class="internal">actions_rcd_data</a>? The answer is
that it needs to exist even when the actions feature is inactive, because it's
still used for parsing predicates for non-action-based rulebooks.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::set_ap</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">, </span><span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ap</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ap</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ap</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="function-syntax">ActionRules::get_ap</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ap</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::within_action_context</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">, </span><span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">an</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arcd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">arcd</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="4-ap2.html#SP7" class="function-link"><span class="function-syntax">ActionPatterns::covers_action</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="identifier-syntax">an</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="function-syntax">ActionRules::required_action</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">ActionRules::required_action</span></span>:<br/>Actions - <a href="4-act.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">actions_rcd_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arcd</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RCD_FEATURE_DATA</span><span class="plain-syntax">(</span><span class="identifier-syntax">actions</span><span class="plain-syntax">, </span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">arcd</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ap</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="4-ap2.html#SP7" class="function-link"><span class="function-syntax">ActionPatterns::single_positive_action</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ap</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="function-syntax">ActionRules::required_action_for_booking</span><span class="plain-syntax">(</span><span class="identifier-syntax">booking</span><span class="plain-syntax"> *</span><span class="identifier-syntax">br</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">imperative_defn</span><span class="plain-syntax"> *</span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Rules::get_imperative_definition</span><span class="plain-syntax">(</span><span class="identifier-syntax">br</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">rule_being_booked</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">id</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="4-rpoa.html#SP4" class="function-link"><span class="function-syntax">ActionRules::required_action</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">id</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">body_of_defn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">runtime_context_data</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">ActionRules::suppress_action_testing</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_runtime_context_data</span><span class="plain-syntax"> *</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ap</span><span class="plain-syntax">) </span><a href="4-ap2.html#SP7" class="function-link"><span class="function-syntax">ActionPatterns::suppress_action_testing</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">idrcd</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ap</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="4-gng.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-im.html">1</a></li><li class="progresschapter"><a href="2-bd.html">2</a></li><li class="progresschapter"><a href="3-sm.html">3</a></li><li class="progresscurrentchapter">4</li><li class="progresssection"><a href="4-ap.html">ap</a></li><li class="progresssection"><a href="4-anaa.html">anaa</a></li><li class="progresssection"><a href="4-ak.html">ak</a></li><li class="progresssection"><a href="4-ac.html">ac</a></li><li class="progresssection"><a href="4-act.html">act</a></li><li class="progresssection"><a href="4-as.html">as</a></li><li class="progresssection"><a href="4-av.html">av</a></li><li class="progresssection"><a href="4-ann.html">ann</a></li><li class="progresssection"><a href="4-ap2.html">ap2</a></li><li class="progresssection"><a href="4-anl.html">anl</a></li><li class="progresssection"><a href="4-apc.html">apc</a></li><li class="progresssection"><a href="4-pap.html">pap</a></li><li class="progresssection"><a href="4-pc.html">pc</a></li><li class="progresssection"><a href="4-ea.html">ea</a></li><li class="progresssection"><a href="4-nap.html">nap</a></li><li class="progresssection"><a href="4-gng.html">gng</a></li><li class="progresscurrent">rpoa</li><li class="progresschapter"><a href="5-pp.html">5</a></li><li class="progresschapter"><a href="6-dlg.html">6</a></li><li class="progressnext"><a href="5-pp.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

